package com.cnpinxi.service;

import com.cnpinxi.dao.PaymentMapper;
import com.cnpinxi.domain.Payment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by Baggio on 2017-11-22.
 */
@Service
public class PaymentServiceImpl implements com.cnpinxi.service.PaymentService {
    @Autowired
    PaymentMapper paymentMapper;

    @Override
    public void insertPayment(Payment payment) {

            paymentMapper.insertPayment(payment);
    }

    @Override
    public Payment getPaymentByOrderId(Long orderId) {
        return paymentMapper.selectByOrderId(orderId);
    }

    @Override
    public Payment getPayment(Payment payment) {
        return paymentMapper.getPayment(payment);
    }

    @Override
    public void modifyPayment(Payment payment) {
        paymentMapper.updatePaymentById(payment);
    }

    @Override
    public List<Payment> selectpaymentListByOrderId(Map<String, String> map) {
        return paymentMapper.selectpaymentListByOrderId(map);
    }

    @Override
    public List<Payment> selectpaymentList(Map<String, String> map) {
        return paymentMapper.selectpaymentList(map);
    }

    @Override
    public Payment selectPayment(Map<String, String> map) {
        return paymentMapper.selectPayment(map);
    }
}
